
#if (!defined(localio_inc))
#define localio_inc

#ifdef __cplusplus
extern"C" {
#endif

/* Get the standard types */
#if !defined(EPILOGUE_TYPES_H)
#include <snmptypes.h>
#endif

#ifdef NEOSNET_STRUCT_ALIGN
#pragma align 1
#endif

typedef struct LCL_FILE_S
        {
        bits8_t  lcl_flags;
        bits8_t *lbuf_start;
        bits8_t *lbuf_next;
        bits8_t *lbuf_end;      /* Address AFTER last byte */
        } LCL_FILE;

#ifdef NEOSNET_STRUCT_ALIGN
#pragma align 0
#endif

#define LCL_MALLOC  0x01    /* LCL_FILE was malloc-ed at open */
#define LCL_EOF     0x80    /* EOF encountered */

/* Start of buffer */
#define Lcl_Start(L) (L)->lbuf_start

#define Lcl_Eof(L) (((L)->lcl_flags&LCL_EOF)?-1:0)
                         
/* Current position in stream. */
#define Lcl_Tell(L) (ALENGTH_T)((L)->lbuf_next - (L)->lbuf_start)

/* Address of current positon in buffer */
#define Lcl_Next(L) (L)->lbuf_next

/* Amount of data left in stream. */
#define Lcl_Size(L) (ALENGTH_T)((L)->lbuf_end - (L)->lbuf_next)

#define GETC_MACRO
#if defined(GETC_MACRO)
/* The following is an macro version of this routine Lcl_Getc */
#define SNMP_LclGetc(L)   ( (((L)->lcl_flags & LCL_EOF) ? -1 :      \
                         (((L)->lbuf_next < (L)->lbuf_end) ?    \
                          (int)(*((L)->lbuf_next++)) :  \
                          (((L)->lcl_flags |= LCL_EOF), -1))))
#endif  /* GETC_MACRO */

extern  LCL_FILE    *SNMP_LclOpen   (LCL_FILE *, bits8_t *, ALENGTH_T);
extern  void         SNMP_LclClose  (LCL_FILE *);
#if !defined(GETC_MACRO)
extern  int          SNMP_LclGetc   (LCL_FILE *);
#endif  /* GETC_MACRO */
extern  int          SNMP_LclPeekc  (LCL_FILE *);
extern  ALENGTH_T    SNMP_LclRead   (LCL_FILE *, bits8_t *, ALENGTH_T);
extern  int          SNMP_LclSeek   (LCL_FILE *, ALENGTH_T, int);
extern  ALENGTH_T    SNMP_LclResize (LCL_FILE *, ALENGTH_T, int);
extern  LCL_FILE    *SNMP_LclDup    (LCL_FILE *, LCL_FILE *);

#ifdef __cplusplus
}
#endif

#endif

